import request from '@/sheep/request';

interface SpuApiParams {
  ids: string[];
  id: string;
  // Add other parameters as needed
}

const SpuApi = {
  // 获得商品 SPU 列表
  getSpuListByIds: (ids: string[]): Promise<any> => {
    return request({
      url: '/product/spu/list-by-ids',
      method: 'GET',
      params: { ids },
      custom: {
        showLoading: false,
        showError: false,
      },
    });
  },
  // 获得商品 SPU 分页
  getSpuPage: (params: any): Promise<any> => {
    return request({
      url: '/product/spu/page',
      method: 'GET',
      params,
      custom: {
        showLoading: false,
        showError: false,
      },
    });
  },
  // 查询商品
  getSpuDetail: (id: string): Promise<any> => {
    return request({
      url: '/product/spu/get-detail',
      method: 'GET',
      params: { id },
      custom: {
        showLoading: false,
        showError: false,
      },
    });
  },
};

export default SpuApi;
